#include "MVector2D.hpp"
#include <math.h>

MVector2D::MVector2D()
{
	x = 0; y = 0;
}

MVector2D::MVector2D(const double& dNewX, const double& dNewY)
{
	x = dNewX; y = dNewY;
}

MVector2D::MVector2D(const MVector2D& vecRef)
{
	x = vecRef.x; y = vecRef.y;
}
/*
MVector2D::MVector2D(MVector2D& vec)
{
	x = vec.x; y = vec.y;
}*/

void MVector2D::set(double dNewX, double dNewY)
{
	x = dNewX; y = dNewY;
}

void MVector2D::normalize()
{
	float length = getLength();

	x = x / length;
	y = y / length;
}

float MVector2D::getLength()
{
	return sqrt(x*x + y*y);
}

//EOF
